let initialState = {
  token: "",
  username: "",
  settingDialogShow: false, //设置
  setUserDialogShow: false, //用户名
  wsalgresult: [],
  currTabItem: {},
  wsInstance: null,
};
const mutations = {
  SETTOKEN(state, token) {
    state.token = token;
  },
  SETUSERNAME(state, username) {
    state.username = username;
  },
  SETWSALGRESULT(state, res) {
    state.wsalgresult = res;
  },
  REFRESHTOKEN(state, token) {
    // state.token = token;
  },
  SETSETTINGDIALOGSHOW(state, show) {
    state.settingDialogShow = show;
  },
  SETUSERDIALOGSHOW(state, show) {
    state.setUserDialogShow = show;
  },
  RESET_STATE(state) {
    Object.keys(state).forEach((key) => {
      state[key] = initialState[key]; // 假设你有一个 initialState 对象来定义初始状态
    });
  },
  SETWSINSTANCE(state, ws) {
    state.wsInstance = ws;
  },
  SETCURRTABITEM(state, item) {
    state.currTabItem = item;
  },
  SET_NEW_FREQUENCY_RESOLUTION(state, resolution) {
    state.newFrequencyResolutionInStore = resolution;
  },
  SET_SAMPLING_RATE(state, rate) {
    state.samplingRate = rate;
  },
};
export default mutations;
